GBML manual / Drawing

animation_frame

Which frame of its animation this object is on, counting from 0 (the first frame in the Animations window). 0 when it is not playing one.

Works differently on Game Boy - Animations play as on the Advance, with smaller limits: a frame lasts up to 650 sixtieths of a second, a frame has at most 4 boxes of each kind, and a game has up to 255 animations.

Works differently on Game Boy Color - Animations play as on the Advance, with smaller limits: a frame lasts up to 650 sixtieths of a second, a frame has at most 4 boxes of each kind, and a game has up to 255 animations.

On other consoles this differs: see Side by side and How the consoles differ.

Syntax

animation_frame: int (read-only)

Description

Which frame of its animation this object is on, counting from 0 (the first frame in the Animations window), read-only. It is 0 when the object is not playing an animation. It is the frame of the animation; frame is the frame of the sprite the animation picked.

Example

if (animation_frame == 2) {
    hsp = 4;
}

Lunges forward on the third frame of the animation.

See also: Animationsanimation_playframe